var e = require;
var t = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0});
var n = (function () {
    function e() {}
    return (
        (e.getInstance = function () {
            return e.instance || (e.instance = new e()), e.instance;
        }),
        (e.setData = function (e, t) {
            "" != e &&
                "" != t &&
                ("Cocos" == this.getEngineName() ? cc.sys.localStorage.setItem(e, t) : Laya.localStorage.setItem(e, t));
        }),
        (e.getData = function (e) {
            var t;
            return (
                ("" !=
                    (t =
                        "Cocos" == this.getEngineName()
                            ? cc.sys.localStorage.getItem(e)
                            : Laya.localStorage.getItem(e)) &&
                    null != t &&
                    null != t) ||
                    (t = ""),
                t
            );
        }),
        (e.setJsonData = function (e, t) {
            "" != e &&
                "" != t &&
                ("Cocos" == this.getEngineName()
                    ? cc.sys.localStorage.setItem(e, JSON.stringify(t))
                    : Laya.localStorage.setItem(e, JSON.stringify(t)));
        }),
        (e.getJsonData = function (e) {
            var t;
            return "" ==
                (t = "Cocos" == this.getEngineName() ? cc.sys.localStorage.getItem(e) : Laya.localStorage.getItem(e)) ||
                null == t ||
                null == t ||
                t == {}
                ? null
                : JSON.parse(t);
        }),
        (e.getEngineName = function () {
            return window.CocosEngine ? "Cocos" : "Laya";
        }),
        e
    );
})();
o.default = n;
